Skip to main content
POST
Generate or edit an image with FLUX.2 [flex]
Best for text and typography in the image. For most use cases, start with FLUX.2 [pro]. See which model to use.

Authorizations

x-key
string
header
required

Body

application/json
prompt
string
required

Text prompt for image generation.

Example:

"ein fantastisches bild"

prompt_upsampling
boolean | null
default:true

Whether to use prompt upsampling.

input_image
string | null

Path to the input image.

input_image_2
string | null

Path to the second input image.

input_image_3
string | null

Path to the third input image.

input_image_4
string | null

Path to the fourth input image.

input_image_5
string | null

Path to the fifth input image.

input_image_6
string | null

Path to the sixth input image.

input_image_7
string | null

Path to the seventh input image.

input_image_8
string | null

Path to the eighth input image.

input_image_blob_path
string | null

Blob path to the input image.

seed
integer | null

Optional seed for reproducibility.

Example:

42

width
integer | null
default:0

Width of the image

Required range: x >= 64
height
integer | null
default:0

Height of the image

Required range: x >= 64
guidance
number | null
default:5

Guidance scale for image generation. High guidance scales improve prompt adherence at the cost of reduced realism.

Required range: 1.5 <= x <= 10
Example:

5

steps
integer | null
default:50

Number of steps for image generation. Higher steps lead to more detailed and realistic images.

Required range: 1 <= x <= 50
Example:

50

safety_tolerance
integer
default:2

Tolerance level for input and output moderation. Between 0 and 5, 0 being most strict, 5 being least strict. If you wish to increase the safety_tolerance beyond these levels please reach out to the team.

Required range: 0 <= x <= 5
output_format
enum<string> | null
default:jpeg
Available options:
jpeg,
png,
webp
webhook_url
string<uri> | null

URL to receive webhook notifications

Required string length: 1 - 2083
webhook_secret
string | null

Optional secret for webhook signature verification

Response

Successful Response

id
string
required
polling_url
string
required
cost
number | null

Cost in credits for this request

input_mp
number | null

Input megapixels (2 decimal places)

output_mp
number | null

Output megapixels (2 decimal places)